package com.heima.apis.article;

import com.heima.apis.article.fallback.IArticleClientFallback;
import com.heima.model.article.dtos.ArticleDto;
import com.heima.model.article.pojos.ApArticleConfig;
import com.heima.model.common.dtos.ResponseResult;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @author Xiao
 * @version 1.0
 * @description 文章feign接口
 * @date 2021/11/23
 */
//@FeignClient(value = "leadnews-article", fallback = IArticleClientFallback.class)
@FeignClient("leadnews-article")
public interface IArticleClient {
    /**
     * 保存文章
     * @param dto
     * @return
     */
    @PostMapping("/api/v1/article/feign/save")
    ResponseResult saveArticle(@RequestBody ArticleDto dto);

    /**
     * 自媒体端上架/下架/删除文章时，同步修改app端文章
     * @param articleConfig
     */
    @PostMapping("/api/v1/article/feign/update")
    ResponseResult delOrDownArticle(@RequestBody ApArticleConfig articleConfig);
}
